<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInvoicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('invoices', function (Blueprint $table) {
            $table->increments('invoice_id')->comment("发票id");
            $table->engine = "innodb";
            $table->integer('user_id')->index()->comment("用户id");
            $table->string("invoice_rise_id")->index()->comment("发票抬头id");
            $table->float("money")->default("0.00")->comment("开票金额");
            $table->boolean("is_use")->default(1)->comment("默认使用");
            $table->boolean("is_delete")->default(0)->comment("是否删除");
            $table->tinyInteger("invoice_type_id")->default(0)->comment("//默认为通用");
            $table->string("invoice_type_message")->default('通用')->comment("默认为通用");
            $table->string("feed_back")->default('')->comment("备注");
            $table->timestamp("create_time")->index()->comment("创建时间");
            $table->timestamp("end_time")->index()->comment("修改时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('invoices');
    }
}
